<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>event-auto-confirm-common</title>
	<%@ include file="../include/common.jsp"%>
	<%@ include file="../include/jbox.jsp"%>
	<%@ include file="../include/table.jsp"%>
	
	<script type="text/javascript">
	function datagrid(){
		var oTable=	$('#depmtList').dataTable();
		oTable.fnPageChange("first",true);
	}
	$(function(){
		//加载grid
		var oTable=	$('#depmtList').dataTable({
			"bProcessing": false, 
			"bServerSide": true,
			"sServerMethod": 'POST',
			"sAjaxSource":'${pageContext.request.contextPath}/event/event-auto-confirm!list.action?resId='+'${resId}',
			"bPaginate": false,
			"bSort": true,
			"bFilter":false,
			"bJQueryUI":false,
			"sPaginationType": "full_numbers",
			"aoColumns":[
				{"mDataProp":"op","":"center","bSortable": false},
				{"mDataProp":"resName","bSortable": false},
				{"mDataProp":"eventTypeName","bSortable": false},
				{"mDataProp":"duration","bSortable": false},
				{"mDataProp":"id","bVisible":false}
			], 
			 "oLanguage": { 
				 "sZeroRecords": "没有找到记录",
					"sInfo":" ",
					"sInfoEmpty": " "
			 },
		    "fnServerParams":function(aoData){
		    	
		    }
		});
	});	
	function add(){
		var url ="iframe:event/event-auto-confirm!add.action?resId="+${resId};
		var opt = { title: "新增事件自动确认",width:500,height:190,buttons: {}};
		getTopWin(window).openjBox(url,opt,'add-event-auto-confirm',window);
	}
	function update(id){
		var url ="iframe:event/event-auto-confirm!input.action?id="+id;
		var opt = { title: "修改事件自动确认",width:520,height:190,buttons: {}};
		getTopWin(window).openjBox(url,opt,'update-event-auto-confirm',window);
	}
	function deleteOne(id){
		var submit = function (v, h, f) {
		    if (v == 'ok') {
		    	$.ajax({
		    		type : "POST",
		    		url : "${pageContext.request.contextPath}/event/event-auto-confirm!delete.action", //请求的action
		    		data : {id:id}, //传的参数
		    		dataType : 'json',
		    		success : function(data) { //结果
		    			window.setTimeout(function () { $.jBox.tip('删除成功。', 'success'); }, 100);
						datagrid();
		    		}
		    	});
		    }
		    else if (v == 'cancel') {
		    }
		    return true; //close
		};
		getTopWin(window).jBox.confirm("确定要删除数据吗？", "提示", submit);
	}
	</script>
  </head>
  
  <body>
  	<h2 class="title-h2"><span><img src="${pageContext.request.contextPath}/style/default/bsm/images/arrow-down.gif"/></span>事件自动确认结果列表</h2>
  	<div class="toolbar" id = "toolbar">
 		<a class="page_add" href="javascript:add();">新增</a>&nbsp;&nbsp;&nbsp;&nbsp;
	</div>
    <div>
	<table id="depmtList" width="100%" cellpadding="0" cellspacing="0" border="0" class="display">
		<thead>
			<tr>
				<th width="5%">操作</th>
				<th width="20%">资源名称</th>
				<th width="20%">事件类别</th>
				<th width="15%">间隔时间</th>
			</tr>
		</thead>
	</table>
	</div>
  </body>
</html>
